//
//  EGMNordicBlePedoOper.h
//  HBSDKPro
//
//  Created by LRB_C on 2020/8/17.
//  Copyright © 2020 林瑞彬. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "EGMStepAndSleepDataListener.h"
#import "EGMHourStepListener.h"

typedef void(^reaStepAndSleepResultBlock)(NSArray <BLeStepDataModel*>*stepDatas,NSArray <BleSleepDataModel*>*sleepDatas);

@interface EGMNordicBlePedoOper : EGMBleSportsOperation

@property (nonatomic,strong,readonly) EGMHourStepListener *hourStepHourListener;
@property (nonatomic,copy) reaStepAndSleepResultBlock stepAndSleepResultBlock;

/**
  读取蓝牙设备 计步 睡眠 历史数据(可能并不包含今天数据)
 先调用 EGMBleDeviceSettingOperation enableMassDataNotify：YES （默认开启）
 读取今天即时数据 调用 EGMBleDeViceInfoOperation enableReadDeviceNotify  readDeviceCurrenInfoData
 */
-(void)writeCmdOfReadStepAndSleepOfflineDataWithBLock:(reaStepAndSleepResultBlock)resultBlock;

/**
开启小时步数notify
 */
-(void)enableHourStepNotify:(BOOL)isEnabled;

/**
 获取最新的小时步数数据 notify 通过通知传出
 NOTIFICATION_HOUR_STEP_UPDATED 参数为字典 @{hour1:step1,hour2:step2,...}
 */
-(void)readHourStepData;

/**
 日期参数 date
 sleeDataModels 因为sdk不做缓存 请自行传入所需BleSleepDataModel来计算
 hourOffset 计算睡眠时间的时间偏移 例：-4:表示从前一天20点开始计算 0表示从当天0点计算
 reaSleepShowDataBlock 回调 BleSleepViewModel（计算结果模型）
 */
-(void)calculateSleepDataForOneDay:(NSDate*)date  withAllSleepModel:(NSArray<BleSleepDataModel*>*)sleeDataModels hourOffset:(NSInteger)hourOffset resultBlock:( void(^)(BleSleepViewModel* resultModel))block;

@end
